<?php
header("Content-type:text/html; charset=utf-8");
require_once ('config.php');
require_once (WEBURL.'/include/conn.php');
require_once (WEBURL.'/login_status_check.php');
require_once (WEBURL.'/article.class.php');
require_once (WEBURL.'/channel.class.php');
$channel_id=0;
if(isset($_GET['channel_id'])){
	$channel_id=$_GET['channel_id'];
}
if($channel_id<0){$channel_id=0;}
$offset=0;
if(isset($_GET['offset'])){
	$offset=$_GET['offset'];
}
if(!checkLogin()){
	if($channel_id!=""){
		$gotopage=base64_encode("article_show.php?channel_id=$channel_id&offset=$offset");
	}else{
		$gotopage=base64_encode("article_show.php");
	}
	header("Location:admin_login.php?gotopage=".$gotopage);

}else{
$smarty->assign("title","现有文章");
$article=new Article();
$articles_information=$article->getArticleInformation($channel_id,12,$offset);
$channel=new Channel();
$all_channel=$channel->getAllChannel("article");
$smarty->assign("articles_information",$articles_information);
$smarty->assign("all_channel",$all_channel);
$smarty->assign("channel_id",$channel_id);
$smarty->display("article_show.htm",md5("article_show.php"));
}